<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><?=$titulo?></title>                
        <link href="<?=$this->config->item('base_url');?>/public/css/style.css" rel="stylesheet" type="text/css" />
        <script src="<?=$this->config->item('base_url');?>/public/js/jquery-1.6.2.js"></script>
        
        <script type="text/javascript" src="<?=$this->config->item('base_url');?>/public/js/flexigrid.pack.js"></script>
	
        <link rel="stylesheet" href="<?=$this->config->item('base_url');?>/public/css/jquery.ui.all.css">
	
        <script src="<?=$this->config->item('base_url');?>/public/js/jquery.ui.position.js"></script>
	<script src="<?=$this->config->item('base_url');?>/public/js/jquery.ui.core.js"></script>
	<script src="<?=$this->config->item('base_url');?>/public/js/jquery.ui.widget.js"></script>
        <script src="<?=$this->config->item('base_url');?>/public/js/jquery.ui.button.js"></script>
        <script src="<?=$this->config->item('base_url');?>/public/js/jquery.ui.tabs.js"></script>
        <script src="<?=$this->config->item('base_url');?>/public/js/jquery.ui.dialog.js"></script>
        <script src="<?=$this->config->item('base_url');?>/public/js/jquery.ui.datepicker.js"></script>
        
        
        <script>
        function salir(){
            if(window.confirm("¿Esta seguro que desea salir?")){
                window.location.href= "<?=$this->config->item('base_url');?>/index.php/logout";
            }
        }
        </script>
    </head>
    <?
    $usuario_session = $this->session->userdata('usuario_session');
    $empresas_usuario = $usuario_session['empresas'];
    $perfiles_usuario = $usuario_session['perfiles'];

    ?>      
    <body>
        <!-- INICIO CABECERA -->
        <table width="1024px" border="0" align="center"> 
        <tr>
            <td colspan="2"> 
                <table width="100%" border="0"> 
                <tr>
                    <td class="titulo">
                         ITCONT
                    </td>
                </tr>
                <tr>
                    <td class="subtitulo"><?=$usuario_session['nm_empresa_contab']?></td>
                </tr>                    
                </table>
            </td>
        </tr>
        <!-- FIN CABECERA -->
      
        <!--MENU HORIZONTAL-->
        <tr>
            <td>
                <table width="100%" class="menu_horizontal">
                    <tr>
                        <td  width="40%"> 
                            <table width="100%">
                            <tr>
                                <td>Usuario:</td>
                                <td><?=$usuario_session['nombre']?></td>
                            </tr>
                            <tr>
                                <td>Rut:</td>
                                <td><?=$usuario_session['rut']?>-<?=$usuario_session['dv']?></td>
                            </tr>                       
                            <tr>
                                <td>Perfiles:</td>
                                <td>
                                    <?foreach ($perfiles_usuario  as $perfil){ 
                                        echo $perfil['nm_perfil'];
                                    }?>
                                    
                                </td>
                            </tr>                             
                            </table>
                        </td>
                        <td  width="60%" valign="top" align="right">
                            <table width="60%" align="right" border="0"  cellspacing="0" cellpadding="0">
                            <tr>
                                <td align="right">Empresas:</td>
                                <td align="right">
                                    <select class="ui-widget-content ui-corner-all" style="width:200px">
                                        <?foreach ($empresas_usuario  as $empresa){ ?>
                                            <option value="<?=$empresa['ID_EMPRESA'];?>"><?=$empresa['NM_EMPRESA'];?></option>                                            
                                        <?}?>
                                    </select>                                    
                                </td>
                                <td align="center">
                                    <table width="100%"  border="0" cellspacing="0" cellpadding="0" border="0" >
                                        <tr>
                                            <td align="center" valing="top" width="1px" style="font-size:9px; padding-top:-10px" >
                                                <a href="javascript:salir()">
                                                    <img src="<?=$this->config->item('base_url');?>/public/images/Logout-48.png" border="0" widht="40px" height="40px" alt="Salir Sistema" />                                                                                           
                                                </a>
                                            </td>                                                
                                        </tr>                
                                    </table>
                                </td>
                            </tr>
 
                            </table>
                        </td>                        
                    </tr>
                </table>                
            </td>
        </tr>
        <!--FIN MENU HORIZONTAL-->
        <tr>
            <!--CUERPO-->
            <td width="1024px" valign="top">      
                <?=$cuerpo?>
            </td>
            <!--FIN CUERPO-->

        </tr>
        <!-- INICIO FOOT-->
        <tr>
            <td colspan="2">
                <table width="100%" border="0" class="pie_pagina"> 
                <tr>
                 <td align="center">
                       Pie Página
                 </td>
                </tr>
                </table>
            </td>
        </tr>
        <!-- FIN FOOT-->
        </table>
    <!-- FIN TEMPLATE -->        
    </body>
</html>

